#include <iostream>
using namespace std;


// Function template to determine the Max Value of two numbers

template <class T> T getMax(T a, T b)
{
    T maxValue = (a > b) ? a : b;
    cout << "Max value of " << a << " and " << b << " is: " << maxValue << endl;
    return maxValue;
}


// Function template to determine the Min Value of two numbers

template <class T> T getMin(T a, T b)
{
    T minValue = (a < b) ? a : b;
    cout << "Min value of " << a << " and " << b << " is: " << minValue << endl;
    return minValue;
}


// Main operation to test the function templates.
// The function templates are called with 'int' and 'float' argument types.

int main(void)
{

    cout << "-------------------------------------------" << endl;


    int smallerInt = -9;
    int biggerInt = 10;

    if (biggerInt == getMax(smallerInt, biggerInt))
    {
        cout << "Max value correct!" << endl;
    }
    else
    {
        cout << "Max value NOT correct!" << endl;
    }

    if (smallerInt == getMin(biggerInt, smallerInt))
    {
        cout << "Min value correct!" << endl;
    }
    else
    {
        cout << "Min value NOT correct!" << endl;
    }


    cout << "-------------------------------------------" << endl;


    float smallerFloat = -152.3;
    float biggerFloat = 49.1;


    if (biggerFloat == getMax(smallerFloat, biggerFloat))
    {
        cout << "Max value correct!" << endl;
    }
    else
    {
        cout << "Max value NOT correct!" << endl;
    }

    if (smallerFloat == getMin(biggerFloat, smallerFloat))
    {
        cout << "Min value correct!" << endl;
    }
    else
    {
        cout << "Min value NOT correct!" << endl;
    }


    cout << "-------------------------------------------" << endl;


    return 0;

}
